﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using 桥接模式.Bridge;
using 桥接模式.Bridge.System;
using static System.Console;

namespace 桥接模式
{
    /// <summary>
    /// 1 多重继承与变化封装
    /// 2 桥接模式：解决多维度的变化
    /// </summary> 
    class Program
    {
        static void Main(string[] args)
        {


            //{
            //    WriteLine("****************************************");
            //    BasePhone phone = new iPhone();
            //    phone.Call();
            //    phone.Text();
            //}
            //{
            //    WriteLine("****************************************");
            //    BasePhone galaxy = new Galaxy();
            //    galaxy.Call();
            //    galaxy.Text();
            //}

            //{
            //    WriteLine("****************************************");
            //    BasePhone phoneAndroid = new iPhoneAndroid();
            //    phoneAndroid.Call();
            //    phoneAndroid.Text();
            //}
            ISystem androidSystem = new AndroidSystem();
            ISystem phoneSystem = new iPhoneSystem();
            ISystem winphoneSystem = new WinphoneSystem();
            {
                WriteLine("*******************Bridge*****************");
                BasePhoneBridge phone = new iPhoneBridge();
                phone.SystemVersion = phoneSystem;
                phone.Call();
                phone.Text();
            }
            {
                WriteLine("*******************Bridge*****************");
                BasePhoneBridge galaxy = new GalaxyBridge();
                galaxy.SystemVersion = androidSystem;
                galaxy.Call();
                galaxy.Text();
            }

            {
                WriteLine("*******************Bridge*****************");
                BasePhoneBridge lumiaBridge = new LumiaBridge();
                lumiaBridge.SystemVersion = winphoneSystem;
                lumiaBridge.Call();
                lumiaBridge.Text();
            }

            Read();
        }
    }
}
